/*
 * Copyright (c) 2017 zhangcm. All Rights Reserved.
 */
package com.jnzc.ocr.serv.shop.vo;

import com.google.common.collect.Lists;
import com.jnzc.ocr.serv.shop.entity.ShopProduct;
import io.swagger.annotations.ApiModelProperty;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author zhangcm
 * @version 1.0, 2017/10/4
 */
public class ShopProductSaveVo {

    @ApiModelProperty(value = "ID")
    private Long id;
    @ApiModelProperty(value = "供应商ID")
    private Long supplierId;
    @ApiModelProperty(value = "分类ID", required = true)
    private Long categoryId;
    @ApiModelProperty(value = "编号", required = true, allowableValues = "range[0, 50]")
    private String no;
    @ApiModelProperty(value = "名称", required = true, allowableValues = "range[0, 50]")
    private String name;
    @ApiModelProperty(value = "主图", required = true)
    private String imageUrl;
    @ApiModelProperty(value = "价格", required = true)
    private BigDecimal price;
    @ApiModelProperty(value = "进货价格")
    private BigDecimal purchasePrice;
    @ApiModelProperty(value = "是否上架", required = true)
    private Boolean ifOnSale;
    @ApiModelProperty(value = "SKU列表", required = true)
    private List<Sku> skuList = Lists.newArrayList();

    public static class Sku {

        @ApiModelProperty(value = "ID")
        private Long id;
        @ApiModelProperty(value = "属性列表", required = true)
        private List<Attr> attrList;
        @ApiModelProperty(value = "价格", required = true)
        private BigDecimal price;
        @ApiModelProperty(value = "数量", required = true)
        private Integer num;

        public Long getId() {
            return id;
        }

        public void setId(Long id) {
            this.id = id;
        }

        public List<Attr> getAttrList() {
            return attrList;
        }

        public void setAttrList(List<Attr> attrList) {
            this.attrList = attrList;
        }

        public BigDecimal getPrice() {
            return price;
        }

        public void setPrice(BigDecimal price) {
            this.price = price;
        }

        public Integer getNum() {
            return num;
        }

        public void setNum(Integer num) {
            this.num = num;
        }
    }

    public static class Attr {
        @ApiModelProperty(value = "ID")
        private Long id;
        @ApiModelProperty(value = "名称", required = true, allowableValues = "range[0, 20]")
        private String name;

        public Long getId() {
            return id;
        }

        public void setId(Long id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getSupplierId() {
        return supplierId;
    }

    public void setSupplierId(Long supplierId) {
        this.supplierId = supplierId;
    }

    public Long getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public BigDecimal getPurchasePrice() {
        return purchasePrice;
    }

    public void setPurchasePrice(BigDecimal purchasePrice) {
        this.purchasePrice = purchasePrice;
    }

    public Boolean getIfOnSale() {
        return ifOnSale;
    }

    public void setIfOnSale(Boolean ifOnSale) {
        this.ifOnSale = ifOnSale;
    }

    public List<Sku> getSkuList() {
        return skuList;
    }

    public void setSkuList(List<Sku> skuList) {
        this.skuList = skuList;
    }
}
